

package javaapp3;

import java.util.Arrays;
import java.util.Collections;
public class JavaApp3 {

      
    public static void main(String[] args) {
        int i;
        int[] arrNums;
        arrNums = new int[6];
        
        arrNums[0] = 10;
        arrNums[1] = 14;
        arrNums[2] = 36;
        arrNums[3] = 27;
        arrNums[4] = 43;
        arrNums[5] = 18;
        
        Arrays.sort(arrNums);
        
        for (i=0; i<arrNums.length; i++ ){
            System.out.println("num: " + arrNums[i]); 
        }
        
        //CREATE AN INTEGER OBJECT ARRAY 
        Integer[] integerArray = new Integer[arrNums.length];
        //Assign the values the the new array 
        for (int a =0; a<arrNums.length; a++){
            integerArray[a] = new Integer(arrNums[a]);
        }
        
        //Sort desending 
        Arrays.sort(integerArray, Collections.reverseOrder());
        
        //Print the result
        for (int a = 0; a<arrNums.length; a++){
           System.out.println("Num: " + integerArray[a]);
        }
    System.exit(0);        
    }
        
    
}
